<template>
	<u-button type="success" open-type="getPhoneNumber" class="getPhoneNumber"  @getphonenumber="getPhoneNumber">手机号快捷登录</u-button>
</template>

<script>
	import { onMounted,reactive } from 'vue'
	import {  onPullDownRefresh,onLoad,onReachBottom  } from '@dcloudio/uni-app'
function getPhoneNumber(){
	uni.request({
		url:  "wxApp/getuserphonenumber?code="+e.detail.code,
		method:"GET",
		success:(res)=> {
			//手机号
			console.log(res.data.data.phone_info.purePhoneNumber);
			uni.request({
				url:  "owner/updateMobileByOpenid?code="+e.detail.code,
				method:"POST",
				data:{
					openid:uni.getStorageSync('openid'),
					purePhoneNumber:res.data.data.phone_info.purePhoneNumber
				},
				success:(res)=> {
					
				}
			})
			
		}
	})
}
onLoad(()=>{
	console.log(111)
})

</script>

<style scoped lang="less">
	.title{
		font-size: 50rpx;
		text-align: center;
		padding-top: 100rpx;
	}
	.getPhoneNumber{
		width: 80%;
		margin-top: 100rpx;
	}
</style>